package chapter01

/**
 * @program lu-scala01
 * @description:
 * @author: zhanglu
 * @create: 2022-02-10 18:28:00
 */

/*
  var 申明变量
  val 申明常量
  能用常量不用变量
 */

class Student(name: String, var age: Int) {

  def printInfo(): Unit = {
    println(name + " " + age + " " + Student.description)
  }

}

object Student {
  val description: String = "666"

  def main(args: Array[String]): Unit = {
    new Student("lu", 24).printInfo()
    val s = new Student("lu", 24)
    s.age = 25
    s.printInfo()
  }

}
